package com.broadengate.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;


import org.apache.struts.Globals;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;

public class ExitAction extends DispatchAction{

	public ActionForward exit(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response){
		
		/******
		 * 用户页面中所有退出按钮实现退出功能
		 * 核心功能删除session中的内容
		 * @param mapping
		 * @param form
		 * @param request
		 * @param response
		 * @return ActionForward 对象
		 */
		System.out.println("进入action");
		HttpSession session=request.getSession();
			   session.removeAttribute("cardNO");
			   session.removeAttribute("customerName");
			   session.removeAttribute("num");
			   session.removeAttribute(Globals.LOCALE_KEY);
			   session.removeAttribute("wrong");
			   session.removeAttribute("psw");
			   return mapping.findForward("success");
	
	}
}
